package io;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) throws FileNotFoundException {
        FileOutputStream fos = new FileOutputStream("note.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bw = new BufferedWriter(osw);
        PrintWriter pw = new PrintWriter(bw, true);//自动行刷新

        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        while (true) {
            if ("exit".equals(str)) {
                break;
            }
            pw.println(str);
            str = sc.nextLine();
        }
        pw.close();
    }
}
